#ifndef SEMANTIC_REASONER_H
#define SEMANTIC_REASONER_H

#include <vector>
#include <set>
#include "src/symbols/wubi/wubi_symbol.h"
#include "src/knowledge/base/knowledge_unit.h"

class SemanticReasoningResult {
public:
    std::vector<WuBiSymbol> inferredSymbols;
    std::vector<KnowledgeUnit*> activatedKnowledge;
    double confidence;
    
    SemanticReasoningResult() : confidence(0.0) {}
};

class SemanticReasoner {
private:
    std::vector<KnowledgeUnit*> knowledgeBase;
    std::vector<InferenceRule> inferenceRules;

public:
    // 基于输入符号进行语义推理
    SemanticReasoningResult reason(const std::vector<WuBiSymbol>& inputSymbols);
    
    // 激活相关知识单元
    std::set<KnowledgeUnit*> activateKnowledge(const std::vector<WuBiSymbol>& symbols);
    
    // 应用推理规则
    std::vector<SemanticReasoningResult> applyInferenceRules(
        const std::vector<WuBiSymbol>& symbols,
        const std::set<KnowledgeUnit*>& activatedKnowledge);
    
    // 整合推理结果
    SemanticReasoningResult integrateResults(
        const std::vector<SemanticReasoningResult>& results);
};

#endif // SEMANTIC_REASONER_H